import request from '@/utils/request'
import store from "@/store";

export function login(data) {
  return request({
    url: '/login',
    method: 'post',
    data: 'username=' + data.username + '&password=' + data.password
  })
}

export function getInfo(token) {
  return request({
    url: '/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/logout?Authorization=pwd&user='+ store.getters.name,
    method: 'post'
  })
}

export function checkInfo(name) {
  return request({
    url: '/checkInfo',
    method: 'get',
    params: { name }
  })
}
